package base.day17.innerclass;

public class TestInterClass5 {
    //匿名内部类
    public static void main(String[] args) {
        InterImpl ii=new InterImpl();
        ii.show();

        new inter() {

            @Override
            public void show() {
                System.out.println("匿名内部类中的方法");
            }
        }.show();

        inter5 inter5=new inter5() {

            @Override
            public void show1() {
                System.out.println("inter5中的show1方法");
            }

            @Override
            public void show2() {
                System.out.println("inter5中的show2方法");
            }
        };
        inter5.show1();
        inter5.show2();

    }
}
interface inter{
    void show();
}
interface inter5{
    void show1();
    void show2();
}
class InterImpl implements inter{

    @Override
    public void show() {
        System.out.println("interimpl重写的show方法");
    }
}